<template>
  <a-dropdown placement="bottomRight">
    <span class="ant-pro-account-avatar">
      <a-avatar size="small" :src="url" class="antd-pro-global-header-index-avatar" />
      <span>{{ name }}</span>
    </span>
    <!-- <template v-slot:overlay>
      <a-menu class="ant-pro-drop-down menu">
        <a-menu-item v-if="menu" key="center" @click="loginOut"> 退出 </a-menu-item>
      </a-menu>
    </template> -->
  </a-dropdown>
</template>

<script>
import storage from 'store'
export default {
  name: 'AvatarDropdown',
  props: {
    menu: {
      type: Boolean,
      default: true
    }
  },
  data () {
    return {
      name: '',
      url: ''
    }
  },
  mounted () {
    this.name = storage.get('name')
    this.url = storage.get('avatar')
  },
  methods: {
  }
}
</script>

<style lang="less" scoped>
.ant-pro-drop-down {
  /deep/ .action {
    margin-right: 8px;
  }
  /deep/ .ant-dropdown-menu-item {
    min-width: 160px;
  }
}
</style>
